package bookManager.operations;

import bookManager.Book;
import bookManager.BookDao;

import java.util.List;
import java.util.Scanner;

public class FindOperation implements IOperation {
    @Override
    public void work() {
        System.out.println("请输入要查找的书名！");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.next();
        BookDao bookDao = new BookDao();
        List<Book> books = bookDao.findBooksByName(name);
        for (Book book : books) {
            System.out.println(book);
        }
        System.out.println("查找书籍完毕！");
    }
}
